#ifndef CUDARGB
#define CUDARGB
#include"../../Global.h"
#include <cuda_runtime.h>
__global__ void RGB32ToYUV444(uchar *RGB, uchar *y, uchar *u, uchar *v, int w, int h);
__global__ void RGB32ToYUV420(uchar *RGB, uchar *y, uchar *u, uchar *v, int w, int h);
class CudaRGB32ToYUV444Service
{
public:
    CudaRGB32ToYUV444Service();

    /// @brief 初始化cuda服务，在cuda上分配空间
    /// @param 图片宽度
    /// @param 图片长度
    CudaRGB32ToYUV444Service(int w,int h);

    /// @brief 释放cuda内存
    ~CudaRGB32ToYUV444Service();
public:
    void RGB32ToYUV444Interface(uchar *RGB,uchar *y,uchar*u, uchar* v,int w, int h); 
    void RGB32ToYUV420Interface(uchar *RGB,uchar *y,uchar*u, uchar* v,int w, int h);
private:
    uchar* d_RGB,*d_y,*d_u,*d_v;
    int w,h;
};
#endif // !CUDARGB

